package com.cq.hd.app.controller;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.app.biz.HfCallbackBiz;
import com.cq.hd.app.biz.PftCallbackBiz;
import com.cq.hd.order.api.pft.PftOrderCallBackParam;
import com.cq.hd.order.api.pft.PftOrderTicketParam;
import com.cq.hd.system.api.dto.HfVerifyDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/pftCallback")
public class PftCallbackController {

    @Autowired
    private PftCallbackBiz pftCallbackBiz;

    // 票付通订单核销和退单通知回调接口
    @PostMapping("/orderCallbck")
    public Object orderCallbck(@RequestBody PftOrderCallBackParam param) {
        if (pftCallbackBiz.orderCallbck(param)) {
            return "200";
        }
        return "-1";
    }

    @GetMapping("/orderCallbck")
    public Object orderCallbck() {
        return "success";
    }

    // 票付通出票通知回调接口
    @PostMapping("/orderTicket")
    public Object orderTicket(@RequestBody PftOrderTicketParam param) {
        if (pftCallbackBiz.orderTicket(param)) {
            return "200";
        }
        return "-1";
    }

    @GetMapping("/orderTicket")
    public Object orderTicket() {
        return "success";
    }
}
